import ProcessDesignPage from "@/views/admin/approver.vue";
import FormControls from "@/components/FormControls/index.js";
import SvgIcon from "@/components/DynamicForm/components/SvgIcon/index.vue";
import store from "@/store/dvadminFlow";
const components = [ProcessDesignPage];

const install = (Vue, options) => {
    if (!options.store) {
        throw new Error("Please provide vuex store.");
    }
    // Register vuex module
    options.store.registerModule("dvadminFlow", store);
    //注册icon组件
    Vue.component("svg-icon", SvgIcon);

    Vue.use(FormControls);
    if (install.installed) return;
    install.installed = true;
    components.forEach((component) => {
        Vue.component(component.name, component);
    });
};

if (typeof window !== "undefined" && window.Vue) {
    install(window.Vue);
}

export default {
    install,
    ProcessDesignPage,
    SvgIcon,
};
